<script>
import useCounter from "@/hooks/useCounter";
export default {
  name: "App",
  setup(props, context) {
    const {counter, add, sub} = useCounter()
    return {
      counter,
      add,
      sub
    }
  }
}
</script>
<template>
  <div id="app">
    <h1>counter:{{ counter }}</h1>
    <button @click="sub">-1</button>
    <button @click="add">+1</button>
  </div>
</template>

<style lang="less"></style>
